package card;

public class CostCalculator {
	public static int calculateCost(CreatureCard c){
		int cost = 0;
		cost += c.getActualMaxHealth();
		double middleDmg = 0;
		for(int minDmg = c.getMinDmg(); minDmg <= c.getMaxDmg(); minDmg++)
			middleDmg += minDmg;
		middleDmg /= (c.getMaxDmg()-c.getMinDmg()+1);
		middleDmg += 0.5;
		cost += (int)middleDmg;
		cost += (c.getBaseDefence()*2);
		/*if(cost <= 5)
			cost -= 2;
		else if(5 < cost && cost <= 10)
			cost -= 1;
		else if(10 < cost && cost <= 15)
			cost -= 0;
		else if(15 < cost && cost <= 20)
			cost += 1;
		else if(20 < cost && cost <= 25)
			cost += 2;
		else if(25 < cost && cost <= 30)
			cost += 3;
		else if(30 < cost && cost <= 35)
			cost += 4;
		else if(30 < cost && cost <= 40)
			cost += 5;*/
		return cost;
	}
}
